<script>
    var ws = new WebSocket("ws://localhost:3000/socketTest");
    ws.onopen = function(){
       ws.send("这是客户端发送的数据");
    };
    ws.onmessage = function (evt){ 
       alert("服务端数据："+evt.data);
    };
 </script>
 